export function returnIcon(url, type) {
  if (type == "1") {
    if (url.indexOf(".doc") !== -1 || url.indexOf(".DOC") !== -1) {
      return require("@/assets/images/resource/doc.png");
    } else if (url.indexOf(".pdf") !== -1 || url.indexOf(".PDF") !== -1) {
      return require("@/assets/images/resource/pdf.png");
    } else if (url.indexOf(".ppt") !== -1 || url.indexOf(".PPT") !== -1) {
      return require("@/assets/images/resource/ppt.png");
    } else if (url.indexOf(".pptx") !== -1 || url.indexOf(".PPTX") !== -1) {
      return require("@/assets/images/resource/pptx.png");
    } else if (url.indexOf(".docx") !== -1 || url.indexOf(".DOCX") !== -1) {
      return require("@/assets/images/resource/docx.png");
    } else if (url.indexOf(".mp4") !== -1 || url.indexOf(".MP4") !== -1) {
      return require("@/assets/images/resource/mp4.png");
    } else if (url.indexOf(".mp3") !== -1 || url.indexOf(".MP3") !== -1) {
      return require("@/assets/images/resource/mp3.png");
    } else if (url.indexOf(".png") !== -1 || url.indexOf(".PNG") !== -1) {
      return require("@/assets/images/resource/png.png");
    } else if (
      url.indexOf(".jpg") !== -1 ||
      url.indexOf(".JPG") !== -1 ||
      url.indexOf(".jpeg") !== -1 ||
      url.indexOf(".JPEG") !== -1
    ) {
      return require("@/assets/images/resource/jpg.png");
    } else if (
      url.indexOf(".xls") !== -1 ||
      url.indexOf(".XLS") !== -1 ||
      url.indexOf(".xlsx") !== -1 ||
      url.indexOf(".XLSX") !== -1
    ) {
      return require("@/assets/images/resource/xls.png");
    } else if (url.indexOf(".wps") !== -1 || url.indexOf(".WPS") !== -1) {
      return require("@/assets/images/resource/wps.jpg");
    } else {
      return require("@/assets/images/resource/other.jpg");
    }
  } else {
    return require("@/assets/images/resource/3d.png");
  }
}
